﻿$().ready(function () {
    var ul = $("#yjstr");
    var timerID;
    var li = ul.children();

    var liHight = $(li[0]).height();
    var upHeight = 0 - 4 * liHight; //滚动的高度；
    var scrollUp = function () {

        ul.animate({ marginTop: upHeight }, "normal", function () {
            for (i = 0; i < 2; i++) {
                ul.find("tr:first").appendTo(ul);
            }
            ul.css({ marginTop: 0 });
        });
    };
    var scrollDown = function () {

        ul.css({ marginTop: upHeight });
        for (i = 0; i < 2; i++) {
            ul.find("tr:last").prependTo(ul);
        }
        ul.animate({ marginTop: 0 }, "normal", function () {
        });
    };
    var autoPlay = function () {
        timerID = window.setInterval(scrollUp, 1500);
    };
    var autoStop = function () {
        window.clearInterval(timerID);
    };
    //事件绑定
    ul.hover(autoStop, autoPlay).mouseout();
})

    $().ready(function () {
    var ul = $("#corpsta");
    var timerID;
    var li = ul.children();

    var liHight = $(li[0]).height();
    var upHeight = 0 - 4 * liHight; //滚动的高度；
    var scrollUp = function () {

        ul.animate({ marginTop: upHeight }, "normal", function () {
            for (i = 0; i < 2; i++) {
                ul.find("tr:first").appendTo(ul);
            }
            ul.css({ marginTop: 0 });
        });
    };
    var scrollDown = function () {

        ul.css({ marginTop: upHeight });
        for (i = 0; i < 2; i++) {
            ul.find("tr:last").prependTo(ul);
        }
        ul.animate({ marginTop: 0 }, "normal", function () {
        });
    };
    var autoPlay = function () {
        timerID = window.setInterval(scrollUp, 1500);
    };
    var autoStop = function () {
        window.clearInterval(timerID);
    };
    //事件绑定
    ul.hover(autoStop, autoPlay).mouseout();
   })